//import 'package:flutter/foundation.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
// import 'package:lib/Test.dart';

import 'main.dart';

enum CXType{
   CXType_one, 
   CXType_two,
   CXType_three
}

void main() {
    //runApp(MyApp());
    final str = 'fdda';
    //str = 'hello';
    const str2 = 'fdfsdgfdg';

    Future.delayed(Duration(seconds:2),(){
        return '我最帅';
    }).then((m) => print(m));

    Future.delayed(Duration(seconds: 2),String() => 'ahhahah');
}

int futureTask() {
    return 21; 
}

void printLength(int length) {
    print("Text Length:$length");
}

void whenTaskCompelete() {
    print("Task Complete");
}

// void main(){
// new Future(() => futureTask)  //  异步任务的函数
//         .then((m) => "futueTask execute result:$m")  //   任务执行完后的子任务
//         .then((m) => m.length)  //  其中m为上个任务执行完后的返回的结果
//         .then((m) => printLength(m))
//         .whenComplete(() => whenTaskCompelete);  //  当所有任务完成后的回调函数
// }

// int futureTask() {
//     return 21; 
// }

// void printLength(int length) {
//     print("Text Length:$length");
// }

// void whenTaskCompelete() {
//     print("Task Complete");
// }


// class MyApp extends StatelessWidget{
//   @override
//   Widget build(BuildContext context) {
//     // TODO: implement build
//     return MaterialApp(
//       title: 'CX测试',
//       // theme: ThemeData(
//       //   primarySwatch: Colors.red
//       // ),
//      // home: SampleAppPage(),
//     );
//   }
// }

class SampleAppPage extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return null;
  }
}